<template>
    <div>
        <!-- 运营档案-车辆档案 -->
        <el-row>
            <el-col :span="24">
                <div class="container">
                    <el-row class="head-fun">
                        <el-col :span="24">
                            <div class="lf choose-title">车属单位</div>
                            <!-- <el-input v-model="CarComp" size="mini" style="width:150px" class="choose-input lf"></el-input> -->
                            <el-autocomplete
                              class="inline-input choose-input lf"
                              v-model="CarComp"
                              :fetch-suggestions="querySearch"
                              placeholder="请输入内容"
                              @select="handleSelect" size="mini" style="width:150px">
                            </el-autocomplete>
                            <div class="lf choose-title">车牌号</div>
                            <el-input v-model="carNum" size="mini" style="width:150px" class="choose-input lf"></el-input>
                            <div class="lf choose-title">允许进站</div>
                            <!-- <el-input v-model="phone" size="mini" style="width:150px" class="choose-input lf"></el-input> -->
                            <el-select v-model="allowIn" placeholder="" size="mini" style="width:150px" class="choose-input lf">
                            <el-option label="" value=""></el-option>
                            <el-option label="是" value="1"></el-option>
                            <el-option label="否" value="0"></el-option>
                            </el-select>
                            <button class="check-btn rf" @click="reset">
                              <img src="../../assets/imgs/operation_btn_icon_chongzhi_default.png" alt="" class="btn-img">重置</button>
                            <button class="check-btn rf custom-btn" @click="check"><img src="../../assets/imgs/operation_btn_icon_chaxun_default.png" alt="" class="btn-img">查询</button>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24" class="table-fun">
                            <img src="../../assets/imgs/operation_icon_shuaxin_default.png" alt="" class="lf"><div class="lf choose-title2 fun-text" @click="refresh">刷新</div>
                            <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt="" class="lf"><div class="lf choose-title2 fun-text" @click="addWin=true;winTitle='添加';med='add'">添加</div>
                            <img src="../../assets/imgs/operation_icon_xiugai_default.png" alt="" class="lf"><div class="lf choose-title2 fun-text" @click="addWin=true;winTitle='修改';med='update'">修改</div>
                            <img src="../../assets/imgs/operation_icon_shanchu_default.png" alt="" class="lf"><div class="lf choose-title2 fun-text" @click="del">删除</div>
                            <img src="../../assets/imgs/operation_icon_shuju_default.png" alt="" class="lf"><div class="lf choose-title2 fun-text" @click="tongbu">同步数据中心</div>
                        </el-col>
                    </el-row>
                    <!-- 表格数据 -->
                    <el-row>
                        <el-col :span="18">
                            <avue-crud :data="carList[0].data" :option="carList[0].option" :page="carList[0].page"   @current-row-change="rowChange" @current-change="carPage"></avue-crud>
                        </el-col>
                        <el-col :span="6" class="car-right">
                          <div class="choose-title carTable-right rightbox">到期证件</div>
                          <div class="choose-title" @click="daoQiShow=true"><img src="../../assets/imgs/lnput_icon_yiwen_default.png" alt=""> 到期提醒 |</div>
                          <avue-crud :data="overTimeList.data" :option="overTimeList.option" v-model="overTimeTable" :page="overTimeList.page" @current-change="overPage"></avue-crud>
                        </el-col>
                        
                    </el-row>
                    <!-- 弹窗 -->
                    <!-- 添加弹窗 -->
                    <div class="modal-win" v-show="addWin">
                      <div class="add-container">
                          <div class="closeWin" @click="addWin=false">X</div>
                          <!-- 标题栏 -->
                          <el-row class="add-title">
                              <el-col :span="24">
                                  <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt=""><span class="add-text">{{winTitle}}车辆</span>
                              </el-col>
                          </el-row>
                          <!-- 选项卡 -->
                          <el-row class="tab carTab">
                            <el-col :span="24">
                              <el-tabs type="border-card">
                                <!-- 基础资料 -->
                                <el-tab-pane label="基础资料">
                                  <el-row>
                                    <el-col :span="16">
                                      <avue-form ref="form" v-model="detailMsg" :option="detailMsgOption" class="yz-form"></avue-form>
                                    </el-col>
                                    <el-col :span="8" class="search-tag">
                                      <img src="../../assets/imgs/operation_bg_sousuo_default.png" alt="" class="lf search-img"><div class="lf choose-title">读取道路运输证信息</div>
                                    </el-col>
                                  </el-row>
                                  <el-row>
                                      <el-col :span="8">
                                         <avue-form ref="form" v-model="detailMsgII" :option="detailMsgOptionII" class="yz-form"></avue-form>
                                      </el-col>
                                      <el-col :span="8" class="car-add-win">座位图</el-col>
                                      <el-col :span="8" class="car-add-win">
                                        <avue-form ref="form" v-model="detailMsgIII" :option="detailMsgOptionIII" class="yz-form"></avue-form>
                                      </el-col>
                                    </el-row>
                                </el-tab-pane>
                                <!-- 详细资料 -->
                                <el-tab-pane label="详细信息">
                                  <avue-form ref="form" v-model="detailForm" :option="detailOption" class="yz-form carForm"></avue-form>
                                </el-tab-pane>
                              </el-tabs>
                              <!-- 按钮 -->
                              <button class="check-btn rf" @click="addWin=false">
                              <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消</button>
                              <button class="check-btn rf custom-btn" @click="med=='add'?add():update()"><img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定</button>
                            </el-col>
                          </el-row>
                          
                      </div>
                    </div>
                </div>
            </el-col>
        </el-row>
        <!-- 同步弹窗 -->
        <div class="tong-win" v-show="tongbuShow">
            <div class="tongbu-text">同步中心数据</div><div class="closeWin" @click="tongbuShow=false">X</div>
            <avue-crud :data="tongbuList[0].data" :option="tongbuList[0].option" @current-row-change="rowChange" class="unit-table" @current-change="carPage" :page="tongbuList[0].page"></avue-crud>
        </div>
        <!-- 到期提醒弹窗 -->
        <div class="daoqi-win" v-show="daoQiShow">
            <div class="tongbu-text">到期提醒设置</div><div class="closeWin" @click="daoQiShow=false">X</div>
             <el-checkbox-group v-model="daoZhanCheckList">
              <el-checkbox  label="线路牌有效期" class="check-item"></el-checkbox><br>
              <el-checkbox  label="等级证有效期"  class="check-item"></el-checkbox><br>
              <el-checkbox  label="二级维护截至日期"  class="check-item"></el-checkbox><br>
              <el-checkbox  label="行车证有效期"  class="check-item"></el-checkbox><br>
              <el-checkbox  label="审验有效期"  class="check-item"></el-checkbox><br>
              <el-checkbox  label="灭火筒年检日期"  class="check-item"></el-checkbox><br>
              <el-checkbox  label="承运人责任险截止日期"  class="check-item"></el-checkbox><br>
              <el-checkbox  label="是否允许进站" class="check-item"></el-checkbox>
            </el-checkbox-group>
            <button class="check-btn rf" @click="daoQiShow=false">
            <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消</button>
            <button class="check-btn rf custom-btn" @click="checkSure"><img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定</button>
        </div>
    </div>
</template>

<script>
import qs from "qs";
import TableData from "../../components/common/tableData"
const DIC = {
  carStyle:[],
  seatLayout:[],
  allow:[
    {
      label:"是",
      value:"1"
    },
    {
      label:"否",
      value:"0"
    },
  ],
  carComp:[],
  carNum:[],
  carType:[],
  seatType:[]
}
export default {
  data: function() {
    return {
      activeTag:"4-2",
      CarComp: "",
      carNum: "",
      allowIn: "",
      currentRow:"",
      carList: [
        {
           page: {
            pageSizes: [10],
            total: 20,
            currentPage: 1,
            pageSize: 10
          },
          data: [],
          option: {
            highlightCurrentRow:true,
            page: true,
            stripe: true,
            menu: false,
            align: "center",
            menuAlign: "center",
            column: []
          }
        }
      ],
      tongbuList: [
        {
           page: {
            pageSizes: [10],
            total: 20,
            currentPage: 1,
            pageSize: 10
          },
          data: [],
          option: {
            highlightCurrentRow:true,
            page: true,
            stripe: true,
            menu: false,
            align: "center",
            menuAlign: "center",
            column: []
          }
        }
      ],
      addRules: {
        "busVehicle.company_id": "1",
        "busVehicle.vehi_no": "123",
        "busVehicle.che_liang_lei_xing": "123",
        "busVehicle.all_seat": "88"
      },
      delID: { id: "1641" },
      tag:0,
      overTimeTable:{},
      overTimeList:{
        page:{
          pageSizes: [10],
          total: 20,
          currentPage: 1,
          pageSize: 10
        },
        data:[],
        option:{
          menu:false,
          page:true,
          column:[
            {
              label:"姓名",
              prop:"item_name"
            },
            {
              label:"到期日期",
              prop:"expire_date"
            },
          ]
        }
      },
      addWin:false,
      detailForm:{},
      detailOption:{
        column:[
          {
            label:"电脑编号",
            prop:"busVehicleid",
            span:8,
          },
          {
            label:"进站证号",
            prop:"busVehiclejzzh",
            span:8,
          },
          {
            label:"配客证号",
            prop:"busVehiclepkzh",
            span:8
          },
          {
            label:"有效期起",
            prop:"busVehiclexlstartdate",
            type:"date",
            span:8
          },
          {
            label:"有效期",
            prop:"busVehiclexlenddate",
            type:"date",
            span:9
          },
          {
            label:"始发站",
            prop:"busVehiclebeginstation",
            span:8
          },
          {
            label:"途经站点",
            prop:"busVehiclevia_station",
            span:8
          },
          {
            label:"终点站",
            prop:"busVehicleendstation",
            span:8
          },
          {
            label:"起点途经",
            prop:"busVehicleqi_dian_shi_qu_tu_jing",
            span:24
          },
          {
            label:"终点途经",
            prop:"busVehiclezhong_dian_shi_qu_tu_jing",
            span:24
          },
          {
            label:"配客站点",
            prop:"busVehicledistribute",
            span:16
          },
          {
            label:"日发班次",
            prop:"busVehiclebuscount",
            span:8
          },
          {
            label:"道路运输证字",
            prop:"busVehicledao_lu_yun_shu_zheng_zhi",
            span:8
          },
          {
            label:"道路运输证号",
            prop:"busVehicledao_lu_yun_shu_zheng_hao",
            span:8
          },
          {
            label:"道路运输发证日期",
            prop:"busVehicledao_lu_yun_shu_zheng_fa_zheng_ri_qi",
            type:"date",
            span:8
          },
          {
            label:"经营许可证字",
            prop:"admFont",
            span:8
          },
          {
            label:"经营许可证号",
            prop:"admNum",
            span:8
          },
          {
            label:"许可证发证日期",
            prop:"admDate",
            type:"date",
            span:8
          },
          {
            label:"行车证有效日期",
            prop:"busVehiclejing_ying_xu_ke_zheng_zhi",
            type:"date",
            span:8
          },
          {
            label:"登记证定有效日期",
            prop:"busVehiclejing_ying_xu_ke_zheng_hao",
            type:"date",
            span:8
          },
          {
            label:"审核有效日期",
            prop:"busVehiclexkzdate",
            type:"date",
            span:8
          },
          {
            label:"灭火筒年检日期",
            prop:"busVehiclefireExtinguisherAnnualCheckDate",
            type:"date",
            span:8
          },
          {
            label:"承运人责任险截止",
            prop:"busVehicleliabilityInsuranceEnddate",
            type:"date",
            span:8
          },
          {
            label:"二级维护截止日期",
            prop:"busVehiclelevel2ndMaintenanceEnddate",
            type:"date",
            span:8
          },
          {
            label:"线路标志牌",
            prop:"busVehiclexlbzph",
            span:24
          },
          {
            label:"厂牌",
            prop:"busVehiclechang_pai",
            span:8
          },
          {
            label:"营运状态",
            prop:"busVehiclevehi_status",
            span:8
          },
          {
            label:"核定车辆座位",
            prop:"busVehiclezuo_wei",
            span:8
          },
          {
            label:"司乘电话",
            prop:"busVehiclesc_tel",
            span:8
          },
          {
            label:"司乘人员",
            prop:"busVehiclesc_name",
            span:8
          },
          {
            label:"司乘座数",
            prop:"busVehiclesc_seat",
            span:8
          },
          {
            label:"座位类型",
            prop:"busVehicleseat_type",
            span:8
          },
          {
            label:"上层座数",
            prop:"busVehicleupseat",
            span:8
          },
          {
            label:"下层座数",
            prop:"busVehiclebelowseat",
            span:8
          },
          {
            label:"车身颜色",
            prop:"busVehicleche_shen_yan_se",
            span:8
          },
          {
            label:"车架号",
            prop:"busVehicleche_jia_hao",
            span:8
          },
          {
            label:"车牌颜色",
            prop:"busVehicleche_pai_yan_se",
            span:8
          },
          {
            label:"车身",
            prop:"busVehicleche_chang",
            span:8
          },
          {
            label:"车宽",
            prop:"busVehicleche_kuan",
            span:8
          },
          {
            label:"车高",
            prop:"busVehicleche_gao",
            span:8
          },
          {
            label:"发动机号",
            prop:"busVehiclefa_dong_ji_hao",
            span:8
          },
          {
            label:"燃料",
            prop:"busVehicleran_liao",
            span:9
          },
          {
            label:"经营范围",
            prop:"busVehiclejing_ying_fan_wei",
            span:8
          },
          {
            label:"车辆装备登记",
            prop:"busVehicleche_liang_zhuang_bei_deng_ji",
            span:8
          },
          {
            label:"技术等级",
            prop:"busVehicleji_shu_deng_ji",
            span:8
          },
          {
            label:"线路牌备注",
            prop:"busVehiclexlbzp_bei_zhu",
            span:8
          },
          {
            label:"客运类别",
            prop:"busVehicleke_yun_lei_bie",
            span:9
          },
          {
            label:"型号",
            prop:"busVehiclexing_hao",
            span:8
          },
          {
            label:"行驶证登记日期",
            prop:"busVehiclexing_shi_zheng_deng_ji_ri_qi",
            type:"date",
            span:8
          },
          {
            label:"装备条件",
            prop:"busVehiclezhuang_bei_tiao_jian",
            span:8
          },
          {
            label:"投入营运日期",
            prop:"busVehicletou_ru_ying_yun_ri_qi",
            type:"date",
            span:8
          },
          {
            label:"是否市标临时牌",
            prop:"busVehicleis_shi_ji_lin_shi_pai",
            span:8
          },
        ]
      },
      detailMsg:{},
      detailMsgOption:{
        dicData:DIC,
        column:[
          {
            label:"车属单位",
            prop:"carComp",
            type:"select",
            dicData:"carComp",
            span:24
          },
        ]
      },
      detailMsgII:{},
      detailMsgOptionII:{
        dicData:DIC,
        column:[
          {
            label:"车牌号",
            prop:"carNum",
            type:"select",
            dicData:"carNum",
            span:24
          },
          {
            label:"车辆类型",
            prop:"carType",
            type:"select",
            dicData:"carType",
            span:24
          },
          {
            label:"座位布局",
            prop:"seatType",
            type:"select",
            dicData:"seatType",
            span:24
          },
          {
            label:"座位数",
            prop:"seatCount",
            span:24
          },
          {
            label:"IC卡卡号",
            prop:"ICNum",
            span:24
          },
          {
            label:"营运线路",
            prop:"yinYunRoad",
            span:24
          },
          {
            label:"允许进站",
            prop:"allowIn",
            type:"select",
            dicData:"allow",
            span:24
          },
          {
            label:"备注",
            prop:"remark",
            type:"textarea",
            span:24
          },
        ]
      },
      detailMsgIII:{},
      detailMsgOptionIII:{
        column:[
          {
            label:"区域名称",
            prop:"placeName",
            span:24
          },
          {
            label:"字体颜色",
            prop:"fontColor",
            span:24
          },
          {
            label:"区域颜色",
            prop:"placeColor",
            span:24
          },
        ]
      },
      winTitle:"",
      med:"",
      compList:[],
      compID:"",
      tongbuShow:false,
      daoQiShow:false,
      checkList:[],
      daoZhanCheckList:[]
    };
  },
  methods: {
    carPage(val){
      this.carList[0].page.currentPage=val;
      if(this.tag==0){
        this.getCarList();
      }else{
        this.tongbu();
      }
    },
    getCarList() {
      this.carList[0].data = [];
      this
        .postRequest("/sch/data/bus_vehicle/list",{
          rows:10,
          page:this.carList[0].page.currentPage
        })
        .then(data => {
          this.carList[0].page.total=data.data.totalRow
          this.carList[0].data=data.data.list;
        });
    },
    refresh() {
      this.getCarList();
    },
    add() {
      this.med="add";
      this.detailForm.busVehicleid="";
      this.detailForm.busVehiclejzzh="";
      this.detailMsgII.seatType="";
      this.detailForm.detailMsgII.seatCount="";
      this.detailForm.ICNum="";
      this.detailForm.allowIn="";
      this.detailForm.remark="";
      this.detailForm.busVehicleid="";
      this.detailForm.busVehiclepkzh="";
      this.detailForm.busVehiclexlstartdate="";
      this.detailForm.busVehiclexlenddate="";
      this.detailForm.busVehiclebeginstation="";
      this.detailForm.busVehiclevia_station="";
      this.detailForm.busVehicleendstation="";
      this.detailForm.busVehicleqi_dian_shi_qu_tu_jing="";
      this.detailForm.busVehiclezhong_dian_shi_qu_tu_jing="";
      this.detailForm.busVehiclebuscount="";
      this.detailForm.busVehicledao_lu_yun_shu_zheng_zhi="";
      this.detailForm.busVehicledao_lu_yun_shu_zheng_hao="";
      this.detailForm.busVehicledao_lu_yun_shu_zheng_fa_zheng_ri_qi="";
      this.detailForm.admFont="";
      this.detailForm.admNum="";
      this.detailForm.admDate="";
      this.detailForm.busVehiclejing_ying_xu_ke_zheng_zhi="";
      this.detailForm.busVehiclejing_ying_xu_ke_zheng_hao="";
      this.detailForm.busVehiclefireExtinguisherAnnualCheckDate="";
      this.detailForm.busVehicleliabilityInsuranceEnddate="";
      this.detailForm.busVehiclelevel2ndMaintenanceEnddate="";
      this.detailForm.busVehiclexlbzph="";
      this.detailForm.busVehiclechang_pai="";
      this.detailForm.busVehiclevehi_status="";
      this.detailForm.busVehiclezuo_wei="";
      this.detailForm.busVehicllesc_tel="";
      this.detailForm.busVehiclesc_name="";
      this.detailForm.busVehiclesc_seat="";
      this.detailForm.busVehicleseat_type="";
      this.detailForm.busVehicleupseat="";
      this.detailForm.busVehiclebelowseat="";
      this.detailForm.busVehicleche_shen_yan_se="";
      this.detailForm.busVehicleche_pai_yan_se="";
      this.detailForm.busVehicleche_jia_hao="";
      this.detailForm.busVehicleche_chang="";
      this.detailForm.busVehicleche_kuan="";
      this.detailForm.busVehicleche_gao="";
      this.detailForm.busVehiclefa_dong_ji_hao="";
      this.detailForm.busVehicleran_liao="";
      this.detailForm.busVehiclejing_ying_fan_wei="";
      this.detailForm.busVehicleche_liang_zhuang_bei_deng_ji="";
      this.detailForm.busVehicleji_shu_deng_ji="";
      this.detailForm.busVehiclexlbzp_bei_zhu="";
      this.detailForm.busVehicleke_yun_lei_bie="";
      this.detailForm.busVehiclexing_hao="";
      this.detailForm.busVehiclexing_shi_zheng_deng_ji_ri_qi="";
      this.detailForm.busVehiclezhuang_bei_tiao_jian="";
      this.detailForm.busVehicletou_ru_ying_yun_ri_qi="";
      this.detailForm.busVehicleis_shi_ji_lin_shi_pai="";
      this
        .postRequest(
          "/sch/data/bus_vehicle/add",{
            "busVehicle.company_id": this.detailForm.busVehicleid,
            "busVehicle.vehi_no": this.detailForm.busVehiclejzzh,
            "": this.detailForm.busVehiclepkzh,
            "busVehicle.layout": this.detailMsgII.seatType,
            "busVehicle.all_seat": this.detailMsgII.seatCount,
            "busVehicle.card_no":  this.detailMsgII.ICNum,
            "busVehicle.xian_lu_ming_cheng": "",
            "org_customs.is_admission": this.detailMsgII.allowIn,
            "busVehicle.bei_zhu": this.detailMsgII.remark,
            "busVehicle.che_liang_dian_nao_bian_hao": this.detailForm.busVehicleid,
            "busVehicle.jzzh": this.detailForm.busVehiclejzzh,
            "busVehicle.pkzh": this.detailForm.busVehiclepkzh,
            "busVehicle.xlstartdate": this.detailForm.busVehiclexlstartdate,
            "busVehicle.xlenddate": this.detailForm.busVehiclexlenddate,
            "busVehicle.beginstation": this.detailForm.busVehiclebeginstation,
            "busVehicle.via_station": this.detailForm.busVehiclevia_station,
            "busVehicle.endstation": this.detailForm.busVehicleendstation,
            "busVehicle.qi_dian_shi_qu_tu_jing": this.detailForm.busVehicleqi_dian_shi_qu_tu_jing,
            "busVehicle.zhong_dian_shi_qu_tu_jing": this.detailForm.busVehiclezhong_dian_shi_qu_tu_jing,
            "busVehicle.busVehiclezhong_dian_shi_qu_tu_jing": "",
            "busVehicle.buscount": this.detailForm.busVehiclebuscount,
            "busVehicle.dao_lu_yun_shu_zheng_zhi": this.detailForm.busVehicledao_lu_yun_shu_zheng_zhi,
            "busVehicle.dao_lu_yun_shu_zheng_hao": this.detailForm.busVehicledao_lu_yun_shu_zheng_hao,
            "busVehicle.dao_lu_yun_shu_zheng_fa_zheng_ri_qi": this.dateToString(this.detailForm.busVehicledao_lu_yun_shu_zheng_fa_zheng_ri_qi),
            "busVehicle.jing_ying_xu_ke_zheng_zhi": this.detailForm.admFont,
            "busVehicle.jing_ying_xu_ke_zheng_hao": this.detailForm.admNum,
            "busVehicle.xkzdate": this.detailForm.admDate,
            "busVehicle.vehiLicenceEnddate": this.dateToString(this.detailForm.busVehiclejing_ying_xu_ke_zheng_zhi),
            "busVehicle.classLicenceEnddate": this.dateToString(this.detailForm.busVehiclejing_ying_xu_ke_zheng_hao),
            "busVehicle.shen_yan_you_xiao_qi": this.dateToString(this.detailForm.busVehiclexkzdate),
            "busVehicle.fireExtinguisherAnnualCheckDate": this.dateToString(this.detailForm.busVehiclefireExtinguisherAnnualCheckDate),
            "busVehicle.liabilityInsuranceEnddate": this.dateToString(this.detailForm.busVehicleliabilityInsuranceEnddate),
            "busVehicle.level2ndMaintenanceEnddate": this.dateToString(this.detailForm.busVehiclelevel2ndMaintenanceEnddate),
            "busVehicle.xlbzph": this.detailForm.busVehiclexlbzph,
            "busVehicle.chang_pai": this.detailForm.busVehiclechang_pai,
            "busVehicle.vehi_status": this.detailForm.busVehiclevehi_status,
            "busVehicle.zuo_wei": this.detailForm.busVehiclezuo_wei,
            "busVehicle.sc_tel": this.detailForm.busVehicllesc_tel,
            "busVehicle.sc_name": this.detailForm.busVehiclesc_name,
            "busVehicle.sc_seat": this.detailForm.busVehiclesc_seat,
            "busVehicle.seat_type": this.detailForm.busVehicleseat_type,
            "busVehicle.upseat": this.detailForm.busVehicleupseat,
            "busVehicle.belowseat": this.detailForm.busVehiclebelowseat,
            "busVehicle.che_pai_yan_se": this.detailForm.busVehicleche_shen_yan_se,
            "busVehicle.che_shen_yan_se": this.detailForm.busVehicleche_pai_yan_se,
            "busVehicle.che_jia_hao": this.detailForm.busVehicleche_jia_hao,
            "busVehicle.che_chang": this.detailForm.busVehicleche_chang,
            "busVehicle.che_kuan": this.detailForm.busVehicleche_kuan,
            "busVehicle.che_gao": this.detailForm.busVehicleche_gao,
            "busVehicle.fa_dong_ji_hao": this.detailForm.busVehiclefa_dong_ji_hao,
            "busVehicle.ran_liao": this.detailForm.busVehicleran_liao,
            "busVehicle.jing_ying_fan_wei": this.detailForm.busVehiclejing_ying_fan_wei,
            "busVehicle.che_liang_zhuang_bei_deng_ji": this.detailForm.busVehicleche_liang_zhuang_bei_deng_ji,
            "busVehicle.ji_shu_deng_ji": this.detailForm.busVehicleji_shu_deng_ji,
            "busVehicle.xlbzp_bei_zhu": this.detailForm.busVehiclexlbzp_bei_zhu,
            "busVehicle.ke_yun_lei_bie": this.detailForm.busVehicleke_yun_lei_bie,
            "busVehicle.xing_hao": this.detailForm.busVehiclexing_hao,
            "busVehicle.xing_shi_zheng_deng_ji_ri_qi": this.dateToString(this.detailForm.busVehiclexing_shi_zheng_deng_ji_ri_qi),
            "busVehicle.zhuang_bei_tiao_jian": this.detailForm.busVehiclezhuang_bei_tiao_jian,
            "busVehicle.tou_ru_ying_yun_ri_qi": this.dateToString(this.detailForm.busVehicletou_ru_ying_yun_ri_qi),
            "busVehicle.is_shi_ji_lin_shi_pai": this.detailForm.busVehicleis_shi_ji_lin_shi_pai
          }
        )
        .then(data => {
          if (data.data[0] == 0) {
            this.$message({
              message: data.data[1],
              type: "success"
            });
            this.getCarList();
            this.getUnitList();
          } else {
            this.$message.error("添加失败！请检查");
          }
        });
    },
    update() {
      this.med="update"
      this
        .postRequest(
          "/sch/data/bus_vehicle/update",{
            "busVehicle.company_id": this.detailForm.busVehicleid,
            "busVehicle.vehi_no": this.detailForm.busVehiclejzzh,
            "": this.detailForm.busVehiclepkzh,
            "busVehicle.layout": this.detailMsgII.seatType,
            "busVehicle.all_seat": this.detailMsgII.seatCount,
            "busVehicle.card_no":  this.detailMsgII.ICNum,
            "busVehicle.xian_lu_ming_cheng": "",
            "org_customs.is_admission": this.detailMsgII.allowIn,
            "busVehicle.bei_zhu": this.detailMsgII.remark,
            "busVehicle.che_liang_dian_nao_bian_hao": this.detailForm.busVehicleid,
            "busVehicle.jzzh": this.detailForm.busVehiclejzzh,
            "busVehicle.pkzh": this.detailForm.busVehiclepkzh,
            "busVehicle.xlstartdate": this.detailForm.busVehiclexlstartdate,
            "busVehicle.xlenddate": this.detailForm.busVehiclexlenddate,
            "busVehicle.beginstation": this.detailForm.busVehiclebeginstation,
            "busVehicle.via_station": this.detailForm.busVehiclevia_station,
            "busVehicle.endstation": this.detailForm.busVehicleendstation,
            "busVehicle.qi_dian_shi_qu_tu_jing": this.detailForm.busVehicleqi_dian_shi_qu_tu_jing,
            "busVehicle.zhong_dian_shi_qu_tu_jing": this.detailForm.busVehiclezhong_dian_shi_qu_tu_jing,
            "busVehicle.busVehiclezhong_dian_shi_qu_tu_jing": "",
            "busVehicle.buscount": this.detailForm.busVehiclebuscount,
            "busVehicle.dao_lu_yun_shu_zheng_zhi": this.detailForm.busVehicledao_lu_yun_shu_zheng_zhi,
            "busVehicle.dao_lu_yun_shu_zheng_hao": this.detailForm.busVehicledao_lu_yun_shu_zheng_hao,
            "busVehicle.dao_lu_yun_shu_zheng_fa_zheng_ri_qi": this.dateToString(this.detailForm.busVehicledao_lu_yun_shu_zheng_fa_zheng_ri_qi),
            "busVehicle.jing_ying_xu_ke_zheng_zhi": this.detailForm.admFont,
            "busVehicle.jing_ying_xu_ke_zheng_hao": this.detailForm.admNum,
            "busVehicle.xkzdate": this.detailForm.admDate,
            "busVehicle.vehiLicenceEnddate": this.dateToString(this.detailForm.busVehiclejing_ying_xu_ke_zheng_zhi),
            "busVehicle.classLicenceEnddate": this.dateToString(this.detailForm.busVehiclejing_ying_xu_ke_zheng_hao),
            "busVehicle.shen_yan_you_xiao_qi": this.dateToString(this.detailForm.busVehiclexkzdate),
            "busVehicle.fireExtinguisherAnnualCheckDate": this.dateToString(this.detailForm.busVehiclefireExtinguisherAnnualCheckDate),
            "busVehicle.liabilityInsuranceEnddate": this.dateToString(this.detailForm.busVehicleliabilityInsuranceEnddate),
            "busVehicle.level2ndMaintenanceEnddate": this.dateToString(this.detailForm.busVehiclelevel2ndMaintenanceEnddate),
            "busVehicle.xlbzph": this.detailForm.busVehiclexlbzph,
            "busVehicle.chang_pai": this.detailForm.busVehiclechang_pai,
            "busVehicle.vehi_status": this.detailForm.busVehiclevehi_status,
            "busVehicle.zuo_wei": this.detailForm.busVehiclezuo_wei,
            "busVehicle.sc_tel": this.detailForm.busVehicllesc_tel,
            "busVehicle.sc_name": this.detailForm.busVehiclesc_name,
            "busVehicle.sc_seat": this.detailForm.busVehiclesc_seat,
            "busVehicle.seat_type": this.detailForm.busVehicleseat_type,
            "busVehicle.upseat": this.detailForm.busVehicleupseat,
            "busVehicle.belowseat": this.detailForm.busVehiclebelowseat,
            "busVehicle.che_pai_yan_se": this.detailForm.busVehicleche_shen_yan_se,
            "busVehicle.che_shen_yan_se": this.detailForm.busVehicleche_pai_yan_se,
            "busVehicle.che_jia_hao": this.detailForm.busVehicleche_jia_hao,
            "busVehicle.che_chang": this.detailForm.busVehicleche_chang,
            "busVehicle.che_kuan": this.detailForm.busVehicleche_kuan,
            "busVehicle.che_gao": this.detailForm.busVehicleche_gao,
            "busVehicle.fa_dong_ji_hao": this.detailForm.busVehiclefa_dong_ji_hao,
            "busVehicle.ran_liao": this.detailForm.busVehicleran_liao,
            "busVehicle.jing_ying_fan_wei": this.detailForm.busVehiclejing_ying_fan_wei,
            "busVehicle.che_liang_zhuang_bei_deng_ji": this.detailForm.busVehicleche_liang_zhuang_bei_deng_ji,
            "busVehicle.ji_shu_deng_ji": this.detailForm.busVehicleji_shu_deng_ji,
            "busVehicle.xlbzp_bei_zhu": this.detailForm.busVehiclexlbzp_bei_zhu,
            "busVehicle.ke_yun_lei_bie": this.detailForm.busVehicleke_yun_lei_bie,
            "busVehicle.xing_hao": this.detailForm.busVehiclexing_hao,
            "busVehicle.xing_shi_zheng_deng_ji_ri_qi": this.dateToString(this.detailForm.busVehiclexing_shi_zheng_deng_ji_ri_qi),
            "busVehicle.zhuang_bei_tiao_jian": this.detailForm.busVehiclezhuang_bei_tiao_jian,
            "busVehicle.tou_ru_ying_yun_ri_qi": this.dateToString(this.detailForm.busVehicletou_ru_ying_yun_ri_qi),
            "busVehicle.is_shi_ji_lin_shi_pai": this.detailForm.busVehicleis_shi_ji_lin_shi_pai
          }
          
        )
        .then(data => {
          if (data.data[0] == 0) {
            this.$message({
              message: data.data[1],
              type: "success"
            });
            this.getUnitList();
          } else {
            console.log(data);
            this.$message.error(data.data[1]);
          }
        });
    },
    del() {
      this
        .postRequest(
          "/sch/data/bus_vehicle/del",{
            id:this.currentRow.id
          },
        )
        .then(data => {
          if (data.data[0] == 0) {
            this.$message({
              message: data.data[1],
              type: "success"
            });
            this.refresh();
          } else {
            this.$message.error("删除失败");
          }
        });
    },
    tongbu() {
      this.tongbuShow=true;
      this
        .postRequest("/sync/center/data/base/busvehi",{
          rows:3,
          page:this.tongbuList[0].page.currentPage
        })
        .then(data => {
          this.tag=1;
          this.tongbuList[0].page.total=data.data.totalRow;
          this.tongbuList[0].data=data.data.list
        });
    },
    tableCreate() {
      this.tongbuList[0].option.column.push(
        {
          label: "单位代码",
          prop: "id"
        },
        {
          label: "单位名称",
          prop: "cust_name"
        },
        {
          label: "车牌号",
          prop: "vehi_no"
        },
        {
          label: "车辆类型",
          prop: "che_liang_lei_xing"
        },
        {
          label: "IC卡卡号",
          prop: "card_no"
        },
        {
          label: "联系电话",
          prop: "sc_tel"
        },
        {
          label: "座位类型",
          prop: "seat_type"
        },
        {
          label: "载客座位数",
          prop: "all_seat"
        },
        {
          label: "允许进站",
          prop: "is_admission"
        },
      );
      this.carList[0].option.column.push(
        {
          label: "单位代码",
          prop: "id"
        },
        {
          label: "单位名称",
          prop: "cust_name"
        },
        {
          label: "车牌号",
          prop: "vehi_no"
        },
        {
          label: "车辆类型",
          prop: "che_liang_lei_xing"
        },
        {
          label: "IC卡卡号",
          prop: "card_no"
        },
        {
          label: "联系电话",
          prop: "sc_tel"
        },
        {
          label: "座位类型",
          prop: "seat_type"
        },
        {
          label: "载客座位数",
          prop: "all_seat"
        },
        {
          label: "允许进站",
          prop: "is_admission"
        },
      );
    },
    sizeChange(){},
    currentChange(){},
    reset(){
      this.getCarList();
    },
    check(){
      this.postRequest("/sch/data/bus_vehicle/list",{
        filterRules:JSON.stringify([
          {"field":"company_id","op":"eq","value":this.compID},
          {"field":"vehi_no","op":"eq","value":this.carNum},
          {"field":"oc.is_admission","op":"eq","value":this.allowIn},
        ]),
        rows:10,
        page:this.carList[0].page.currentPage
      }).then(data=>{
        this.carList[0].page.total=data.data.totalRow;
        this.carList[0].data=data.data.list;
      })
    },
    overPage(val){
      this.overTimeList.page.currentPage=val;
      this.getOverTimeList();
    },
    getOverTimeList(){
      this.postRequest("/sch/data/bus_vehicle/expire/list",{
        rows:10,
        page:this.overTimeList.page.currentPage
      }).then(data=>{
        this.overTimeList.page.total=data.data.totalRow
        this.overTimeList.data=data.data.list
      })
    },
    querySearch(queryString, cb) {
        var restaurants = this.compList;
        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
        // 调用 callback 返回建议列表的数据
        cb(results);
      },
      createFilter(queryString) {
        return (restaurant) => {
          return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
        };
      },
      getcompList(){
        this.postRequest("/sch/data/bus_company/listWithSpell").then(data=>{
          for(var item of data.data){
            this.compList.push({
              value:item.name,
              id:item.id
            });
          }
        })
      },
      getcarComp(){
        this.postRequest("/sch/data/bus_company/listWithSpell").then(data=>{
          for(var item of data.data){
            DIC.carComp.push({
              label:item.name,
              value:item.id
            })
          }
        })
      },
      getcarNum(){
        this.postRequest("/sch/data/bus_vehicle/listWithSpell").then(data=>{
          for(var item of data.data){
            DIC.carNum.push({
              label:item.vehi_no,
              value:item.vehi_no
            })
          }
        })
      },
      getcarType(){
        this.postRequest("/sch/const/bus_vehicle_type/listWithSpell").then(data=>{
          for(var item of data.data){
            DIC.carType.push({
              label:item.name,
              value:item.id
            });
          }
        })
      },
      getseatType(){
        this.postRequest("/sch/data/seatlayout/listWithName").then(data=>{
          for(var item of data.data){
            DIC.seatType.push({
              label:item.name,
              value:item.id
            });
          }
        })
      },
      checkSure(){
        // this.postRequest
        this.daoQiShow=false;
      },
    rowChange(val){
      console.log(val);
      this.currentRow=val;
      this.detailMsgII.carNum=val.vehi_no;
      this.detailMsgII.carType=val.vehi_type;
      this.detailMsgII.seatCount=val.all_seat;
      this.detailMsgII.ICNum=val.card_no;
      this.detailMsgII.allowIn=val.is_admission?"是":"否";
      this.detailMsgII.remark=val.bei_zhu;
    }
  },
  computed: {},
  components:{TableData},
  watch: {
    CarComp(){
      for(var item of this.compList){
        if(this.CarComp==item.value){
          this.compID=item.id
        }
      }
    }
  },
  mounted() {
    console.log("carList");
    this.$emit("sendActive",this.activeTag);
    this.tableCreate();
    this.getCarList();
    this.getOverTimeList();
    this.getcompList();
    this.getcarComp();
    this.getcarNum();
    this.getcarType();
    this.getseatType()
  }
};
</script>
<style scoped src="../../assets/css/service/carList.css">


</style>